#Makefile for dsth lib
CC = g++ -Wall -g
BIN = ../bin
INCLUDE =
LIB = -lpthread
SRC = 	DSTHSocket.cpp\
	DSTHSocketOps_POSIX.cpp\
	InetSocketAddress.cpp\
	Log.cpp\
	Timestamp.cpp\
	BaseThread.cpp\
	Channel.cpp\
	EventLoop.cpp\
	ChannelBuffer.cpp\
	Connection.cpp\
	Acceptor.cpp\
	Connector.cpp\
	ReactorThread.cpp\
	ReactorThreadPool.cpp\
	ClientBootstrap.cpp\
	ServerBootstrap.cpp\
	DSTHEpoll_POSIX.cpp
	

TARGET = libdsth.so
OBJS := $(SRC:.cpp=.o)

all : $(OBJS)
	$(CC) -o $(TARGET) $(OBJS) $(LIB) -shared -fPIC
	cp $(TARGET) $(BIN)
	#link libdsth.so successfully.
	
%.o:%.cpp
	$(CC) -o $@ -c $<

.PHONY:clean
clean:
	-rm -f $(OBJ) $(TARGET) *.o
